package com.sunyard.constant.manage;

/**
 * 正则表达式
 *
 * @author tianch.liu
 * @author daox.nie
 * @created 2016-11-24 上午11:57:40
 */
public class RegexConst {
    //只能是数字
    public static final String NUMBER = "^[0-9]*$";

    //密码15位的数字和字母组合，不能纯数字或纯字母
    public static final String PWDREGEX = "^(?![^A-Za-z]+$)(?![^0-9]+$)[\\x21-x7e]{15}$";

    //大于0的正整数
    public static final String NUMBER_GT_ZERO = "^[+]{0,1}(\\d+)$";


    //11位数字
    public static final String MOBILE_NO = "^\\d{11}$";
    //长度最长20
    public static final String PHONE = "^.{1,20}$";
    //电话号码, 可以为空
    public static final String MOBILE_PHONE = "^1[0-9][0-9]\\d{8}$|^$";
    //手机号11位校验
    public static final String TEL_NUMBER = "^((13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(17[013678])|(18[0-9]))\\d{8}$";
    // 手机号 座机号
    public static final String TEL_MOBILE = "(^[1][3,4,5,7,8,9][0-9]{9}$)|(^((0\\d{2,3})?[-]?\\d{7,8})$)";

    //1位数字
    public static final String TYPE_1 = "^\\d{1}$";
    //2位数字
    public static final String TYPE_2 = "^\\d{2}$";
    //4位数字
    public static final String TYPE_4 = "^\\d{4}$";
    //时分秒
    public static final String HH_MM_SS = "^([0-1][0-9]|[2][0-3]):([0-5][0-9]):([0-5][0-9])$";


    //最短1位，最长16位
    public static final String TEXT_16 = "^.{1,16}$";
    //最短1位，最长20位
    public static final String TEXT_20 = "^.{1,20}$";
    //最短1位，最长32位
    public static final String TEXT_32 = "^.{0,32}$";
    //最短1位，最长64位
    public static final String TEXT_64 = "^.{1,64}$";
    //最短1位，最长128位
    public static final String TEXT_128 = "^.{1,128}$";
    //最短1位，最长256位
    public static final String TEXT_256 = "^.{1,256}$";
    //最短1位，最长512位
    public static final String TEXT_512 = "^.{1,512}$";

    //32位大写字母或数字,适用于使用PrimaryKeyUtil生成的主键
    public static final String ID = "^[A-Z0-9]{32}$";

    /*---------------branch---------*/
    //5位数字
    public static final String BRANCH_CODE = "[0-9]{5}$";
    //description
    public static final String PARENT_CODE = "[0-9]{10}$";
    //机构类型为1位数字，有0,1,2,3、4三种情况,1-总行 2-分行 3-一级支行 4-二级支行
    public static final String BRANCH_LEVEL = "^(1|2|3|4*)$";
    //description
    public static final String BRANCH_TYPE = "^(0|1*)$";


    /*--------------role--------------*/
    public static final String ROLE_NAME = "^.{1,64}$";
    //description
    public static final String ROLE_REMARK = "^.{1,256}$";
    /*--------------role--------------*/

    //description
    public static final String DEVICE_ID = "^[0-9]{8}$";

    //密码为6-15位
    public static final String PWD = "^[a-zA-Z0-9]{6,15}$";

    //身份证校验
    public static final String CERTIF = "^(\\d{18}$)|(^\\d{15}$)";

    //14位，精确到秒的日期时间，20161105140156
    public static final String DEFAULT_DATE = "^\\d{14}$";
    //12位，精确到秒的日期时间，161105140156
    public static final String TMS_DATE = "^\\d{12}$";
    //6位，精确到月的日期时间，201612
    public static final String MONTH_DATE = "^\\d{6}$";
    //8位，精确到日的日期时间，20161206
    public static final String DAY_DATE = "^\\d{8}$";
    //10位，精确到日的日期时间，2016-12-06
    public static final String YYYY_MM_DD = "^\\d{4}-\\d{2}-\\d{2}$";

    //-------------------merchant--------------------------------//
    //只能输入22,24,25,26
    public static final String MCHNT_SVC_TP = "^(22|24|25|26*)$";
    //长度最长20
    public static final String EPOS_PHONE = "^.{1,20}$";
    //长度最长40
    public static final String MCHNT_CN_ABBR = "^.{1,40}$";
    //长度最长60 (经营地址)
    public static final String BUSINESS_ADDR = "^.{1,60}$";
    //长度15位
    public static final String MCHNT_CD = "^.{15}$";

    //只能输入941开头
    public static final String NET_MCHNT_CD = "^(941.*)";
    //长度最长60
    public static final String BUSS_ADDR = "^.{1,60}$";
    //0-未开启1-已开启
    public static final String AGR_MCHNT_STATUS = "^(0|1*)$";
    //4位数字
    public static final String MCC_CD_18 = "^\\d{4}$";
    //只能输入01,02,03,04
    public static final String NET_MCHNT_SVC_TP = "^(01|02|03|04*)$";
    //长度最长25
    public static final String SETTLE_NO = "^.{1,25}$";
    //0-本行卡 1-所有卡 2-不设置
    public static final String T0_FLAG = "^(0|1|2*)$";
    //3位数字
    public static final String ETPS_ATTR = "^\\d{3}$";
    //-------------------app--------------------------------//
    //5位数字
    public static final String APP_TYPE_ID = "^\\d{5}$";
    //长度1~15
    public static final String APP_PKG_VER_LEN = "^.{1,15}$";
    //版本格式例如1.0.0
    public static final String APP_PKG_VER = "^[0-9].[0-9].[0-9]$";
    //长度4位
    public static final String PARAMETER_LENTH = "^\\d{1,4}$";

    //-------------------manage--------------------------------//
    //长度1,8
    public static final String PLATFORM_CODE = "^.{1,8}$";
    //长度1,50
    public static final String APP_VER = "^.{1,50}$";
    //长度1,20
    public static final String PORT = "^.{1,20}$";
    //长度1,40
    public static final String FORTY = "^.{1,40}$";
    //长度1,60
    public static final String GPRS_MSG = "^.{1,60}$";
    //description
    public static final String CDMA_ACCESS = "^.{1,60}$";
    //description
    public static final String ALERT_MSG = "^.{1,30}$";
    //description
    public static final String AUTO_REDIAL_TIME = "^\\d{1,4}$";
    //节假日类型为1、2
    public static final String LOGIN_TYPE = "^(1|2*)$";

    //-------------------check--------------------------------//
    //复核状态码只能为1，2
    public static final String CHECK_CODE = "^(1|2*)$";
    //复核理由不超过512位
    public static final String CHECK_REASON = "^.{0,512}$";

    //-------------------audit--------------------------------//
    //审核状态码只能为0, 1，2
    public static final String AUDIT_CODE = "^(0|1|2*)$";
    //审核理由不超过512位
    public static final String AUDIT_REASON = "^.{0,512}$";

    //-------------------bankAd--------------------------------//
    //银行广告描述不超过64位
    public static final String BANK_AD_DEC = "^.{0,64}$";

    //-------------------city--------------------------------//
    //省、市、区编号为1-4位数字
    public static final String CITY_ID = "^[0-9]{1,4}$";

    //-------------------payBusiness--------------------------------//
    //缴费类型为1-2位数字
    public static final String BUSI_TYPE = "^[0-9]{1,2}$";

    //-------------------riskPara--------------------------------//
    //钥匙类型为0、1、2、3、4
    public static final String KEY_TYPE = "^(1|2|3|4*)$";
    //锁类型为1、2、3
    public static final String LOCK_TYPE = "^(1|2|3*)$";
    //交易类型为4位数字
    public static final String TRANS_TYPE = "^[0-9]{4}$";
    //交易限额为1-18位数字
    public static final String TRANS_LIMIT = "^([0-9]*(\\.?)[0-9]*){1,18}$";

    //-------------------holiday--------------------------------//
    //节假日类型为0、1
    public static final String HOLIDAY_TYPE = "^(0|1*)$";


    //------------------DeviceBrand----------------------------//
    //厂商名字
    public static final String BRAND_NAME_GEGEX = "^[a-zA-Z0-9\\u4e00-\\u9fa5]{1,40}$";

    //终端类型名字
    public static final String DEVICE_TYPE_NAME_GEGEX = "^[a-zA-Z0-9\\u4e00-\\u9fa5]{1,40}$";
    //终端型号名字
    public static final String DEVICE_MODEL_NAME_GEGEX = "^[a-zA-Z0-9\\u4e00-\\u9fa5\\-]{1,40}$";

    //版本格式例如1.00
    public static final String API_VERSION = "^[0-9]+.[0-9][0-9]+$";

    //只能输入p/q
    public static final String MSG_TYPE = "^(p|q)$";
    //只能输入3DES
    public static final String CRYPT_ALG = "^(3DES)$";
    //只能输入0/1 设备状态
    public static final String DEV_STATE = "^(0|1)$";
    //mac算法
    public static final String MAC_ALG = "^(00|01|02)$";
    //OS
    public static final String OS_TYPE = "^(0|1|2)$";

    //------------------App----------------------------//
    //应用名字
    public static final String APP_NAME_GEGEX = "^([a-zA-Z0-9\\u4e00-\\u9fa5]{1,40})?$";
    public static final String APP_VERSION = "^[0-9]+.[0-9].[0-9]+$";
    //------------------AppPkg----------------------------//


    //-----------------机构相关---------------------------//
    //机构名称
    public static final String ORG_NAME_GEGEX = "^[a-zA-Z0-9\\u4e00-\\u9fa5]{1,40}$";
    //机构码
    public static final String ORG_ID = "^.{1,30}$";

    //------------------------用户----------------------//
    public static final String OP_NAME = "^.{1,30}$";

    public static final String URL_REGEX = "/manage/[A-Za-z]*/[A-Za-z]*";

    //------------------------cardbin----------------------//
    public static final String CARD_DC_TYPE = "^((1|2|))?$";
    public static final String CARD_NO_LEN = "^(16|19)$";
    public static final String UNIONPAY_FLAG = "^((0|1))?$";
    public static final String ISSUER_BANK_TYPE = "^(0|1)$";


    /**
     * 18位数字 门店号
     */
    public static final String SHOP_ID = "^\\d{18}$";

    /**
     * 特殊字符
     */
    public static final String SPECIAL_CHAR = "[`~!@#$%^&*()-+=|{}':;',\\[\\].<>/?！，。；：～“”’‘（）·……【】、？——￥......]";

    /**
     * 匹配出HTML中的标签属性
     */
    public static final String HTML_TAG = "<\\\\/?\\\\w+((\\\\s+\\\\w+(\\\\s*=\\\\s*(?:\".*?\"|'.*?'|" +
            "[\\\\^'\">\\\\s]+))?)+\\\\s*|\\\\s*)\\\\/?>";

    /**
     * 中文或英文 最短2位，最长20位
     */
    public static final String REAL_NAME = "^[\\u4E00-\\u9FA5A-Za-z]{2,20}";

    /**
     * 姓名校验
     * 1.不能有特殊字符和数字
     * 2.可以输入英文，可以有空格，可以输入英文名字中间的点
     * 3.可以输入汉字
     * 4.中英文不能同时出现
     * 5..长度1-20
     */
    public static final String NAME_CHECK = "^([\\u4e00-\u9fa5]{1,20}|[a-zA-Z\\.\\s]{1,20})$";

    /**
     * 只能输入1，2，3
     */
    public static final String CONTACT_TYPE = "^(1|2|3*)$";

    /**
     * 2-10位
     */
    public static final String USER_NAME = "^[\\u4E00-\\u9FA5A-Za-z0-9]{2,10}$";

    /**
     * 只能是0-9的数字，小数点后两位，长度不超过6位
     */
    public static final String Fee_TYPE = "(^[0-9]{1,4}([.][0-9]{1,2})?$)";

    /**
     * 是否类只能是0或1
     */
    public static final String TRUE_FALSE = "^(0|1)$";

    /**
     * 巡检任务状态只能为 0 1 2 3 4 5 6 7 或空
     */
    public static final String INSPECT_STATUS = "^.{0}|^(0|1|2|3|4|5)";

    public static final String INSPECT_STATUS_PAD = "^.{0}|^(1|2|3|4|5|6)";

    /**
     * 巡检任务ID32位或空
     */
    public static final String INSPECT_ID = "^.{0}$|^.{32}$";

    /**
     * 查询机构嘛
     */
    public static final String QUERY_ORG_ID = "^,{0}$|^\\d{9}$";

    /**
     * 10位，精确到日的日期时间，2016-12-06或空
     */
    public static final String YYYY_MM_DD_NO = "^.{0}$|^\\d{4}-\\d{2}-\\d{2}$";


    /**
     * 商户状态:  1-启用状态 2-停用状态 3-注销状态 或空
     */
    public static final String MCHNT_STATUS = "^.{0}|^(1|2|3)";

    /**
     * 间联商户入驻状态 00-成功  01-失败 02-未入驻 或空
     */
    public static final String CREEATE_STATUS = "^.{0}|^(00|01|02)";

    /**
     * 是否类只能是0或1 或空
     */
    public static final String TRUE_FALSE_EN = "^.{0}|^(0|1)$";

    /**
     * 是否开通免密免签 01-不开通、02-仅开通免签、03-开通免密免签 Secret
     */
    public static final String IS_NO_SECRET = "^(01|02|03)";

    /**
     * 通道类型 只能是1 2 或空
     */
    public static final String CHANNEL_TYPE = "^.{0}|^(1|2)$";

    /**
     * 包含中文字符
     */
    public static final String CONTAINS_CHINESE = ".*[\u4e00-\u9fa5]{1,}.*";
}
